package met.cs664.ai.cox.soc.strategies.placement;

/**
 * A placement hex location on the SOCBoard and its associated desirability as calculated by our scoring strategies.
 *
 * @author mcox
 * @since 2014/12/1
 */
public class PlacementCandidate implements Comparable<PlacementCandidate> {

    /** Where on the board does this node exist */
    private int coord;

    /** What weight does this node have */
    private float weight;

    public PlacementCandidate(int coord) {
        this.coord = coord;
    }

    @Override
    public String toString() {
        return String.format("%s,%f", Integer.toHexString(coord), weight);
    }

    @Override
    public int compareTo(PlacementCandidate o) {
        return Float.valueOf(o.getWeight()).compareTo(Float.valueOf(this.getWeight()));
    }

    public int getCoord() {
        return coord;
    }

    public void setCoord(int coord) {
        this.coord = coord;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public void updateWeight(float weight) {
        this.weight += weight;
    }
}
